<%@ page import="com.touzi.constants.MobileCons" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="com.touzi.utils.MyHTTPUtils" %>
<%@ page import="org.apache.ibatis.session.SqlSessionFactory" %>
<%@ page import="com.touzi.constants.DbCons" %>
<%@ page import="com.touzi.mapper.UserMapper" %>
<%@ page import="com.touzi.beans.dbs.users.User" %>
<%@ page import="com.touzi.mapper.TongjiMapper" %><%--
  Created by IntelliJ IDEA.
  User: w7851
  Date: 2018/5/16
  Time: 7:49
  个人主页
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<%
    Cookie usercookie = MyHTTPUtils.getCookieByName(request, MobileCons.COOKIE_USERNAME);
    String userphone = usercookie.getValue();
    SqlSession sqlSession = ((SqlSessionFactory) application.getAttribute(DbCons.DB_FACTORY)).openSession();
    UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
    TongjiMapper tongjiMapper = sqlSession.getMapper(TongjiMapper.class);
    User user = userMapper.findUserByDhmw(userphone).get(0);

    int jryxzt = tongjiMapper.getTodayYXTJ(user.id);
    String cyQqfh = "未参与"; //参与全球分红
    if (jryxzt >= 2) {
        cyQqfh = "已参与";
    }

    sqlSession.close();

    request.setAttribute("user", user);
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>

    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>

    <link rel="stylesheet" href="/css/ydui.css">
    <script src="/js/ydui.flexible.js"></script>
    <style type="text/css">
        .xuanzed {
            color: #E8574E;
        }

    </style>
</head>
<body>
<div class="g-flexview">
    <header class="m-navbar  navbar-fixed">
        <div class="navbar-center"><span class="navbar-title">个人中心</span></div>
    </header>
    <div class="g-scrollview" style="margin-top: 0.9rem;margin-bottom: 0.9rem">

        <div style="width: 100%;height: 100px;background-color: white;margin-top: 10px;position: relative">
            <img style="width: 80px;height: 80px;border-radius: 80px;position: absolute;left: 10px;top: 10px;border: #888 solid 1px"
                 src="/pics/me2.jpg">

            <div style="position: absolute;left: 100px;top: 20px">
                <div style="font-size: 20px">我的ID: ${user.id}</div>
                <div style="font-size: 20px">推荐人: ${user.tuijianren}</div>
            </div>
        </div>

        <div class="m-celltitle" style="margin-top: 20px">提现</div>
        <div class="m-cell">
            <a class="cell-item" href="/mobile?method=gomobilepage&page=tixiansq">
                <div class="cell-left"><i class="cell-icon icon-shield-outline"></i>提现(可提${user.keyong})</div>
                <div class="cell-right cell-arrow"></div>
            </a>
        </div>


        <div class="m-celltitle" style="margin-top: 20px">资金相关</div>
        <div class="m-cell">
            <a class="cell-item" href="/mobile?method=gomobilepage&page=myorders">
                <div class="cell-left"><i class="cell-icon icon-compose"></i>我的订单</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="/mobile?method=gomobilepage&page=myyongjin">
                <div class="cell-left"><i class="cell-icon icon-good"></i>我的佣金</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="/mobile?method=gomobilepage&page=mytuandui">
                <div class="cell-left"><i class="cell-icon icon-ucenter-outline"></i>我的团队</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="/mobile/qqfh.jsp">
                <div class="cell-left"><i class="cell-icon icon-discover"></i>直推奖励</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="/mobile/yjtdjiangli.jsp">
                <div class="cell-left"><i class="cell-icon icon-star-outline"></i>永久团队奖励</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="/mobile?method=gomobilepage&page=mystreams">
                <div class="cell-left"><i class="cell-icon icon-footmark"></i>我的流水</div>
                <div class="cell-right cell-arrow"></div>
            </a>
        </div>


        <div class="m-celltitle" style="margin-top: 20px">个人</div>
        <div class="m-cell">
            <a class="cell-item" href="/mobile/xiugaimima.jsp">
                <div class="cell-left"><i class="cell-icon icon-setting"></i>修改信息</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="javascript:;">
                <div class="cell-left"><i class="cell-icon icon-question"></i>问题帮助</div>
                <div class="cell-right cell-arrow"></div>
            </a>
            <a class="cell-item" href="/mobile?method=exitlog">
                <div class="cell-left"><i class="cell-icon icon-error xuanzed"></i>退出登陆</div>
                <div class="cell-right"></div>
            </a>
        </div>
    </div>

    <footer class="m-tabbar tabbar-fixed">
        <a href="/mobile?method=gomobilepage&page=index" class="tabbar-item">
        <span class="tabbar-icon">
           <i class="icon-home"></i>
        </span>
            <span class="tabbar-txt">首页</span>
        </a>

        <a href="javascript:void(0)" class="tabbar-item">
        <span class="tabbar-icon">
            <i class="icon-ucenter-outline xuanzed"></i>
        </span>
            <span class="tabbar-txt xuanzed">我的</span>
        </a>

        <a href="/mobile/share.jsp" class="tabbar-item">
        <span class="tabbar-icon">
            <i class="icon-share1"></i>
        </span>
            <span class="tabbar-txt">邀请</span>
        </a>
    </footer>
</div>
</body>
<script src="/js/jquery-3.3.1.min.js"></script>
<script src="/js/ydui.js"></script>
</html>
